<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>sdps: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">sdps
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">sdps Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This file contains the implementation of <a class="el" href="struct_x_sd_ps.html" title="The XSdPs driver instance data. ">XSdPs</a> driver.This driver is used initialize read from and write to the SD card. Features such as switching bus width to 4-bit and switching to high speed, changing clock frequency, block size etc. are supported. SD 2.0 uses 1/4 bus width and speeds of 25/50KHz. Initialization, however is done using 1-bit bus width and 400KHz clock frequency. SD commands are classified as broadcast and addressed. Commands can be those with response only (using only command line) or response + data (using command and data lines). Only one command can be sent at a time. During a data transfer however, when dsta lines are in use, certain commands (which use only the command line) can be sent, most often to obtain status. This driver does not support multi card slots at present.</p>
<p>Intialization: This includes initialization on the host controller side to select clock frequency, bus power and default transfer related parameters. The default voltage is 3.3V. On the SD card side, the initialization and identification state diagram is implemented. This resets the card, gives it a unique address/ID and identifies key card related specifications.</p>
<p>Data transfer: The SD card is put in tranfer state to read from or write to it. The default block size is 512 bytes and if supported, default bus width is 4-bit and bus speed is High speed. The read and write functions are implemented in polled mode using ADMA2.</p>
<p>At any point, when key parameters such as block size or clock/speed or bus width are modified, this driver takes care of maintaining the same selection on host and card. All error bits in host controller are monitored by the driver and in the event one of them is set, driver will clear the interrupt status and communicate failure to the upper layer.</p>
<p>File system use: This driver can be used with xilffs library to read and write files to SD. (Please refer to procedure in diskio.c). The file system read/write example in polled mode can used for reference.</p>
<p>There is no example for using SD driver without file system at present. However, the driver can be used without the file system. The glue layer in filesytem can be used as reference for the same. The block count passed to the read/write function in one call is limited by the ADMA2 descriptor table and hence care will have to be taken to call read/write API's in a loop for large file sizes.</p>
<p>Interrupt mode is not supported because it offers no improvement when used with file system.</p>
<p>eMMC support: SD driver supports SD and eMMC based on the "enable MMC" parameter in SDK. The features of eMMC supported by the driver will depend on those supported by the host controller. The current driver supports read/write on eMMC card using 4-bit and high speed mode currently.</p>
<p>Features not supported include - card write protect, password setting, lock/unlock, interrupts, SDMA mode, programmed I/O mode and 64-bit addressed ADMA2, erase/pre-erase commands.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
<hr/>

1.00a hk/sg  10/17/13 Initial release
2.0   hk      03/07/14 Version number revised.
2.1   hk     04/18/14 Increase sleep for eMMC switch command.
                      Add sleep for microblaze designs. CR# 781117.
2.2   hk     07/28/14 Make changes to enable use of data cache.
2.3   sk     09/23/14 Send command for relative card address
                      when re-initialization is done.CR# 819614.
                                        Use XSdPs_Change_ClkFreq API whenever changing
                                        clock.CR# 816586.
2.4     sk         12/04/14 Added support for micro SD without
                                                WP/CD. CR# 810655.
                                        Checked for DAT Inhibit mask instead of CMD
                                                Inhibit mask in Cmd Transfer API.
                                        Added Support for SD Card v1.0
2.5     sg              07/09/15 Added SD 3.0 features
      kvn     07/15/15 Modified the code according to MISRAC-2012.
2.6   sk     10/12/15 Added support for SD card v1.0 CR# 840601.
2.7   sk     11/24/15 Considered the slot type befoe checking CD/WP pins.
      sk     12/10/15 Added support for MMC cards.
             01/08/16 Added workaround for issue in auto tuning mode
                      of SDR50, SDR104 and HS200.
      sk     02/16/16 Corrected the Tuning logic.
      sk     03/01/16 Removed Bus Width check for eMMC. CR# 938311.
2.8   sk     04/20/16 Added new workaround for auto tuning.
             05/03/16 Standard Speed for SD to 19MHz in ZynqMPSoC. CR#951024
3.0   sk     06/09/16 Added support for mkfs to calculate sector count.
      sk     07/16/16 Added support for UHS modes.
      sk     07/07/16 Used usleep API for both arm and microblaze.
      sk     07/16/16 Added Tap delays accordingly to different SD/eMMC
                      operating modes.
      sk     08/13/16 Removed sleep.h from <a class="el" href="xsdps_8h.html">xsdps.h</a> as a temporary fix for
                      CR#956899.
3.1   mi     09/07/16 Removed compilation warnings with extra compiler flags.
      sk     10/13/16 Reduced the delay during power cycle to 1ms as per spec
      sk     10/19/16 Used emmc_hwreset pin to reset eMMC.
      sk     11/07/16 Enable Rst_n bit in ext_csd reg if not enabled.
      sk     11/16/16 Issue DLL reset at 31 iteration to load new zero value.
3.2   sk     11/30/16 Modified the voltage switching sequence as per spec.
      sk     02/01/17 Added HSD and DDR mode support for eMMC.
      sk     02/01/17 Consider bus width parameter from design for switching
      vns    02/09/17 Added ARMA53_32 support for ZynqMP CR#968397
      sk     03/20/17 Add support for EL1 non-secure mode.</pre><pre></pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
